package com.yonggle.springbootdemo.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduleService {

    private static final Logger logger = LoggerFactory.getLogger(ScheduleService.class);

    @Autowired
    private AsyncService asyncService;

    @Scheduled(fixedDelay = 10000L)
    public void test() {
        logger.info("Scheduled task start");
        asyncService.test();
        logger.info("Scheduled task end");
    }
}
